<template>
  <tr>
    <th>
      <input type="checkbox" v-model="shopName.checked" />
    </th>
    <th>{{ shopName.name }}</th>
    <th>{{ shopName.price }}</th>

    <th>
      <button @click="jian(index)">-</button>

      {{ shopName.num }}
      <button @click="jia(index)">+</button>
    </th>

    <!-- 总价 -->
    <th>{{ shopName.num * shopName.price }}</th>
    <th><button @click="del">删除</button></th>
  </tr>
</template>

<script>
export default {
  props: ["index", "shopName"],

  data() {
    return {};
  },
  //方法
  methods: {
    jia(index) {
      this.$emit("jia", index);
    },
    jian(index) {
      this.$emit("jian", index);
    },
    del() {
      this.$emit("delE",this.index)
    },
  },
  //过滤器
  filters: {},
  // 计算属性
  computed: {},
  // 侦听器
  watch: {},
  // 组件名
  components: {},
};
</script>

<style scoped>
</style>
